#include <iostream>
#include <cmath>
using namespace std;
typedef long long LL;
const int N=1e6+10;
LL a[N];
int n;
int main()
{
	cin>>n;
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		int p=log2(a[i]);
		int t=1;
		while(p--)
		{
         	t*=2;		
		}
		if(t==a[i])
		ans++;
	}
	cout<<ans;
	return 0;
} 
